package com.chb.test.ThreadZIndex_05;

public class ThreadDemo {
    public static void main(String[] args) {
        // setPriority(int newPriority) 设置线程优先度
        // final int getPriority() 获取线程优先度
        MyRunnable mr = new MyRunnable("坦克");
        int priority = mr.getPriority();
        mr.start();
        System.out.println(priority); // 默认为5
        MyRunnable mr1 = new MyRunnable("飞机");
        mr.setPriority(1);
        mr1.setPriority(10);
        int priority1 = mr1.getPriority();
        System.out.println(priority1);
        mr1.start();
    }
}
